package com.gress.shop.vo;

import java.util.HashMap;

/**
 * 构建返回集合类 , 用于表格分页
 * */
public class ResultMap<T> extends HashMap {
    public static final String ERROR_CODE = "errorCode";
    public static final String DATA = "data";
    public static final String RECORD = "record";
    public static final String MESSAGE = "message";

    public static final int ERROR = 0;
    public static final int SUCCESS = 1;

    public static final String TOTAL_KEY = "total";
    private int total;

    public ResultMap(T t, int total) {
        put(DATA, t);
        this.total = total;
        put(TOTAL_KEY,total);
    }
}
